package com.zhq.apputil.widget.config;

import android.graphics.Color;

import androidx.annotation.ColorInt;

/**
 * @author ZHQ
 * @create 2019/11/25
 * @Describe 圆形弧度图片配置项
 */
public class GildeImageConfig {


    private int radius;
    private int mBorderColor;
    private int mBorderWidth;
    private boolean mBorderOverlay;
    private boolean leftTop;
    private boolean rightTop;
    private boolean leftBottom;
    private boolean rightBottom;

    public int getRadius() {
        return radius;
    }

    public int getBorderColor() {
        return mBorderColor;
    }

    public int getBorderWidth() {
        return mBorderWidth;
    }

    public boolean isBorderOverlay() {
        return mBorderOverlay;
    }

    public boolean isLeftTop() {
        return leftTop;
    }

    public boolean isRightTop() {
        return rightTop;
    }

    public boolean isLeftBottom() {
        return leftBottom;
    }

    public boolean isRightBottom() {
        return rightBottom;
    }

    public GildeImageConfig(Builder builder) {
        this.radius = builder.radius;
        this.mBorderColor = builder.mBorderColor;
        this.mBorderWidth = builder.mBorderWidth;
        this.mBorderOverlay = builder.mBorderOverlay;
        this.leftTop = builder.leftTop;
        this.rightTop = builder.rightTop;
        this.leftBottom = builder.leftBottom;
        this.rightBottom = builder.rightBottom;
    }


    public static class Builder {
        private int radius = 2;
        private int mBorderColor = Color.WHITE;
        private int mBorderWidth = 2;
        private boolean mBorderOverlay = false;
        private boolean leftTop = false;
        private boolean rightTop = false;
        private boolean leftBottom = false;
        private boolean rightBottom = false;


        /***
         * 是否添加圆形线条宽度
         * @param mBorderOverlay
         * @return
         */
        public Builder setBorderOverlay(boolean mBorderOverlay) {
            this.mBorderOverlay = mBorderOverlay;
            return this;
        }

        /***
         *设置圆形的弧度
         * @param radius
         * @return
         */
        public Builder setOverlayRadius(int radius) {
            this.radius = radius;
            return this;
        }

        /***
         * 设置边界颜色值
         * @param mBorderColor
         * @return
         */
        public Builder setBorderColor(@ColorInt int mBorderColor) {
            this.mBorderColor = mBorderColor;
            return this;
        }

        /***
         * 设置边界的宽度
         * @param mBorderWidth
         * @return
         */
        public Builder setBorderWidth(int mBorderWidth) {
            this.mBorderWidth = mBorderWidth;
            return this;
        }

        /**
         * 是否设置圆形的左上角
         *
         * @param leftTop
         * @return
         */
        public Builder setOverlayLeftTop(boolean leftTop) {
            this.leftTop = leftTop;
            return this;
        }

        /**
         * 是否设置圆形的左下角
         *
         * @param leftBottom
         * @return
         */
        public Builder setOverlayLeftBottom(boolean leftBottom) {
            this.leftBottom = leftBottom;
            return this;
        }

        /**
         * 是否设置圆形的右上角
         *
         * @param rightTop
         * @return
         */
        public Builder setOverlayRightTop(boolean rightTop) {
            this.rightTop = rightTop;
            return this;
        }

        /**
         * 是否设置圆形的右下角
         *
         * @param rightBottom
         * @return
         */
        public Builder setOverlayRightBottom(boolean rightBottom) {
            this.rightBottom = rightBottom;
            return this;
        }


        public GildeImageConfig build() {
            return new GildeImageConfig(this);
        }


    }

}
